package com.example.demo.modules.demo.services.impl;

import com.example.demo.common.r2dbc.BaseServiceImpl;
import com.example.demo.modules.demo.entity.User;
import com.example.demo.modules.demo.repository.UserRepository;
import com.example.demo.modules.demo.services.UserService;
import org.springframework.data.relational.core.query.Criteria;
import org.springframework.data.relational.core.query.Query;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

@Service
public class UserServiceImpl extends BaseServiceImpl<UserRepository, User, String> implements UserService {

    @Override
    public Mono<User> test(){
        return baseRepository.findOneWithQuery(Query.query(Criteria
                        .where("name").in("test")
                        .and("phone").is("1346896646")
                ));
    }
}
